<?php
/*$l=count($albumDetail);
for($i=0; $i<=$l; $i++){
	echo 'PRINT ID'.$albumDetail[$i]['album_id'];
}*/
$album=stripslashes(str_replace(".","",$_GET['album'])); 
						If(!is_dir($files_path.$album)) {
							$album="";
						}
						$folder=@explode("/",$album);
						If($album) {
							$nav="<a href=\"".$script_url."?action=vault\">Home</a> ";
						} 
						$count=@count($folder);
						
						for($i=0;$i<$count;$i++) {
							If($folder[$i]) {		
								$path.=$folder[$i]."/";		
						
								If(($count-2) > $i) {
									$nav .=" > <a href=\"".$script_url."?action=vault&album=".$path."\">".ucwords($folder[$i])."</a> ";
								} Else {
									$nav .=" > <a href=\"".$script_url."?action=vault&album=".$path."\">".ucwords($folder[$i])."</a> ";
								}
							}
						}
						Echo($nav);
						$dir=@opendir($full_server.$album);						
						 
						$files = glob($files_path . "*");
						
						if($album=='')
						{	
													
							echo '<ul>'; 
							//print each file name
							
							 //foreach($files as $file)
							//{
								$l=count($albumDetail);
								for($i=0; $i<=$l; $i++){
							 //check to see if the file is a folder/directory
							 //if(is_dir($file))
							 //{
								$foldername = explode($files_path, $file);
								$imgfiles =  glob("view/vault/".$albumDetail[$i]['user_id']."/image/".$albumDetail[$i]['album']."/*.*");
							 echo "<li class='vaultthumb '>";
								echo "<a href=\"".$script_url."?action=vault&album=".$albumDetail[$i]['album']."/\">";
										echo "<img src='view/vault/".$_SESSION['user_id']."/image/".$albumDetail[$i]['album']."/".$albumDetail[$i]['url']."' style=\"border:0px;\" alt=\"".ucwords($display_name)."\"   class='thumbicon' />";
								echo "</a>";
										echo "<div class='details '>
												<p>".$albumDetail[$i]['album']."</p>";
												echo '<div class="views">
														<span>Files : '.count($imgfiles).'</span>
														<div class="iconset">
															<img src="view/img/vault_icons/16/settings.png" alt="">
														</div>
														<div class="icondown">
															<img src="view/img/vault_icons/16/download.png" alt="">
														</div>
													 </div>
											</div>';
								echo '</li>'; 							  
							 //}
								}
							//}
							
							echo '</ul>';
						}
						else
						{
							echo '<br><br><ul>';
							$imgfiles = glob($files_path."/".$album."/*.*");
							for ($i=0; $i<count($imgfiles); $i++)
						{
							$num = $imgfiles[$i];
							if($type=='image')
							{
								echo '<li class="vaultthumb">';
									echo '<img src="'.$num.'" alt="random image" class="imgbox">';

									echo '<div class="imgdetails ">
											<p> Bills Wills end</p>
											
											<div class="views">
												<span>views 10,120,12</span>
												<div class="iconflg">
													<img src="view/img/vault_icons/16/flag.png" alt="">
												</div>
												<div class="iconset">
													<img src="view/img/vault_icons/16/settings.png" alt="">
												</div>
														
												<div class="icondown">
													<a href="view/vault/'.$_SESSION['user_id'].'/image/'.$albumDetail[$i]['album'].'/download_file.php?file='.$albumDetail[$i]['url'].'">
													<img src="view/img/vault_icons/16/download.png" alt="">
													</a>
												</div>
											  </div>
											</div>';
								echo '</li>';			
							}
							else
							{
								echo '<li>'.$num.'</li>';
							}
							}
							echo '</ul>';
							echo "<div class='cleaner'>&nbsp;</div>";
							
							 $uploader=new PhpUploader();
                                
                                $uploader->MultipleFilesUpload=true;
                                $uploader->InsertText="Add More Images (Max 1000M)";
                                
                                $uploader->MaxSizeKB=1024000;
                                $uploader->AllowedFileExtensions="*.jpg,*.png,*.gif,*.bmp,*.txt,*.zip,*.rar";
                                
                                $uploader->SaveDirectory=$files_path."/".$album;
                                
                                $uploader->FlashUploadMode="Partial";
                                
                                $uploader->Render();
						}
?>